package com.yoomiito.app.present.my.activity;

import com.yoomiito.app.base.AppConfig;
import com.yoomiito.app.base.BaseActPresenter;
import com.yoomiito.app.model.bean.BankBean;
import com.yoomiito.app.model.bean.SaleBean;
import com.yoomiito.app.model.my.MyInviteBean;
import com.yoomiito.app.net.YmApi;
import com.yoomiito.app.ui.my.MySaleActivity;
import com.yoomiito.app.ui.my.RealNameActivity;
import com.yoomiito.app.utils.YMToast;

import java.util.concurrent.TimeUnit;

import cn.droidlover.xdroidmvp.net.ApiException;
import cn.droidlover.xdroidmvp.net.ApiSubscriber;
import cn.droidlover.xdroidmvp.net.BaseModel;
import cn.droidlover.xdroidmvp.net.XApi;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;

public class MySalePresenter extends BaseActPresenter<MySaleActivity> {

    public MySalePresenter(AppConfig appConfig) {
        super(appConfig);
    }


    public void getAchieve() {
        YmApi.getYmService()
                .getAchieve()
                .compose(getV().bindToLifecycle())
                .compose(XApi.<SaleBean>getApiTransformerData())
                .compose(XApi.<SaleBean>getScheduler())
                .subscribe(new ApiSubscriber<SaleBean>(handleException()) {
                    @Override
                    public void onSuccess(SaleBean data) {
                        getV().setData(data);
                    }
                    @Override
                    public void onFail(ApiException error) {
                    }
                });
    }





}
